package itsos.service.impl;

import itsos.model.*;
import itsos.service.*;
import itsos.dao.*;

import java.sql.Timestamp;
import java.util.*;

import javax.servlet.http.*;

import org.springframework.web.servlet.ModelAndView;
import itsos.common.*;


public class IssueBoxServiceImpl implements IssueBoxService {
	
	private IssueBoxDao issueBoxDao;
	
	public void setIssueBoxDao(IssueBoxDao issueBoxDao)
	{
		this.issueBoxDao = issueBoxDao;
	}

	public void deleteIssueBox(HttpServletRequest request) {
		
		IssueBox issueBox = new IssueBox();
					
		issueBoxDao.deleteIssueBox(issueBox);
		
	}

	public List getIssueBox(HttpServletRequest request) {
	
		List list;
		IssueBox issueBox = new IssueBox();
		HttpSession session = request.getSession();
		issueBox.setMemberID((Long)session.getAttribute("memberID"));
		
		list = issueBoxDao.getIssueByMemberID(issueBox.getMemberID());
				
		return list;
	}

	public void insertIssuebox(HttpServletRequest request) {
		
		IssueBox issueBox = new IssueBox();
		HttpSession session = request.getSession();
		issueBox.setMemberID((Long)session.getAttribute("memberID"));
		issueBox.setIssueID(new Long(Long.parseLong(request.getParameter("issueID"))));
		issueBox.setInsertTime(new Timestamp(System.currentTimeMillis()));
		issueBox.setInsertUserID(issueBox.getMemberID());
		
		
		issueBoxDao.insertIssueBox(issueBox);
		
	}
	
	

}
